package de.hszg.wjl.datacore.model;

import static org.junit.Assert.*;

import org.junit.Test;

import de.hszg.wjl.datacore.model.LocationQuestion.Position;

public class LocationQuestionTest extends QuestionTest<LocationQuestion> {

	@Test
	public void testGetAwnser() {

		LocationQuestion question = new LocationQuestion();
		Position position = new Position(12.2939232323, -45.3993849834);
		question.setPosition(position);
		System.out.println(question.getAnswer());
		assertTrue(question.getAnswer().equals("12.29392,-45.39938"));

	}

	@Test
	public void testXMLParsing() {
		LocationQuestion question = createQuestion();
		assertTrue(question.getType() == QuestionType.LOCATION);
		assertTrue(question.getID().equals("2"));
		assertTrue(!question.isRequired());
		assertTrue(question.getText().equals("Where are you now?"));
	}

	@Override
	protected String getQuestionXML() {
		return "<question type='location' required='false' id='2'><text>Where are you now?</text></question>";

	}

}
